package com.fary.web.context.support;

import com.fary.core.io.DefaultResourceLoader;
import com.fary.core.io.Resource;

import javax.servlet.ServletContext;

public class ServletContextResourceLoader extends DefaultResourceLoader {

	private final ServletContext servletContext;

	public ServletContextResourceLoader(ServletContext servletContext) {
		this.servletContext = servletContext;
	}

	@Override
	protected Resource getResourceByPath(String path) {
		return new ServletContextResource(this.servletContext, path);
	}

}